-
Notifications
You must be signed in to change notification settings - Fork 31k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http: coerce content-length to number #57458
base: main
Are you sure you want to change the base?
Conversation
Review requested:
|
b82ed47
to
e8c4486
Compare
nit: The ad-hoc term for it in the ES spec is |
Also,
Throwing |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #57458 +/- ##
==========================================
+ Coverage 90.20% 90.22% +0.02%
==========================================
Files 629 629
Lines 184948 184937 -11
Branches 36204 36214 +10
==========================================
+ Hits 166837 166867 +30
+ Misses 11057 11041 -16
+ Partials 7054 7029 -25
🚀 New features to boost your workflow:
|
e8c4486
to
da674a9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
That would break |
{ | ||
const server = http.createServer(common.mustCall((req, res) => { | ||
res.strictContentLength = true; | ||
// Pass content-length as string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would move the whole test to a separate file. This more about value type than length mismatch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Fixes: #57456
Either we implictly convert or throw an error. Id would convert it.
We can use one the million tricks to convert it to integer
~~
,+
,*1
etc... not sure whats consistent with the rest of the project, I found~~
used often